package com.jcl.recruit.timer.crawler;

import com.jcl.recruit.timer.crawler.constants.CrawlerChannelConstants;
import com.jcl.recruit.timer.crawler.service.CrawlerChannelResumeJx;
import com.jcl.recruit.timer.crawler.service.CrawlerChannelResumeProxy;
import com.jcl.recruit.timer.crawler.service.CrawlerChannelResumeTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

/**
 * @ClassName CrawlerChannelResumeTask
 * @Description TODO
 * @Author yyliu
 * @Date 2018/10/30 16:00
 * @Version 1.0
 **/
@Component
public class CrawlerChannelResumeTask {

    @Autowired
    private CrawlerChannelResumeTaskService crawlerChannelResumeTaskService;

    @Scheduled(cron = "0 30 * * * ?")
    @Transactional
    public String lagouCrawler(){

        String message = crawlerChannelResumeTaskService.crawlerChannelResume(CrawlerChannelConstants.CHANEL_LAGOU);
        return message;
    }

    @Scheduled(cron = "0 20 * * * ?")
    @Transactional
    public String bossCrawler(){

        String message = crawlerChannelResumeTaskService.crawlerChannelResume(CrawlerChannelConstants.CHANEL_BOSS);
        return message;
    }

    @Scheduled(cron = "0 40 * * * ?")
    @Transactional
    public String zhaopinCrawler(){
        String message = crawlerChannelResumeTaskService.crawlerChannelResume(CrawlerChannelConstants.CHANEL_ZHAOPIN);
        return message;
    }

    @Scheduled(cron = "0 50 * * * ?")
    @Transactional
    public String liepinCrawler(){
        String message = crawlerChannelResumeTaskService.crawlerChannelResume(CrawlerChannelConstants.CHANEL_HOUNT);
        return message;
    }

    @Scheduled(cron = "0 10 * * * ?")
    @Transactional
    public String dajieCrawler(){
        String message = crawlerChannelResumeTaskService.crawlerChannelResume(CrawlerChannelConstants.CHANEL_DAJIE);
        return message;
    }
}
